package com.lalilu.lmedia.repository

import com.lalilu.lmedia.entity.LSong
import kotlinx.coroutines.flow.Flow

interface FavoriteRepository {
    suspend fun addToFavorite(song: LSong)
    suspend fun addToFavorite(mediaId: String)

    suspend fun removeFromFavorite(song: LSong)
    suspend fun removeFromFavorite(mediaId: String)

    /**
     * 判断某首歌是否处于喜欢列表中
     */
    fun checkIsFavorite(mediaId: String): Flow<Boolean>

    /**
     * 确保喜欢列表存在（不存在则新建）
     */
    suspend fun makeSureFavoritePlaylistExist(pId: Long = FAVORITE_PLAYLIST_ID)

    companion object {
        const val FAVORITE_PLAYLIST_ID = -1L
    }
}